<script setup lang="ts">
  import { onMounted, ref, shallowRef, useTemplateRef } from 'vue';
  import { ElLoading, ElMessage } from 'element-plus';

  import { useBim } from './useBim';

  const {
    target,
    initViewer,
    load,
    addClickEvent,
    addBoxClassificationPrimitive,
    copyActiveTileset
  } = useBim();

  onMounted(() => {
    initViewer();
  });
</script>

<template>
  <el-container>
    <el-aside style="width: fit-content">
      <div class="flex flex-col gap-[10px]">
        <el-button type="primary" @click="load">1-加载模型数据</el-button>
        <el-button type="primary" @click="addClickEvent()">2- addClickEvent</el-button>
        <el-button type="primary" @click="addBoxClassificationPrimitive()"
          >2- addBoxClassificationPrimitive</el-button
        >
        <el-button type="primary" @click="copyActiveTileset({ x: 50, y: 0, z: 0 })"
          >复制模型</el-button
        >
        <!-- <el-button type="primary" @click="loadBimData">加载空间数据</el-button> -->
        <!-- <el-button type="primary" @click="open()">加载用户数据</el-button> -->
        <!-- //<el-button type="primary" @click="startFusion">开始数据融合</el-button> -->
        <!-- <el-button type="primary" @click="upload">导出融合后的数据</el-button> -->
      </div>
    </el-aside>
    <el-container>
      <el-main style="--el-main-padding: 0" class="flex overflow-hidden">
        <div id="cesiumContainer" class="h-[100vh]" ref="target"></div>
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<style scoped lang="less"></style>
